local ClientOHOH = _G.ClientOHOH;

local M = ClientOHOH.class.new(script, ClientOHOH.files.BaseObject())
local CallBackManager = ClientOHOH.load.CallBackManager();

local instStr={
    s1="ctrl.RuleDes.s1", 
    s2 ="ctrl.RuleDes.s2",
    s3="ctrl.RuleDes.s3", 
    e1 ="ctrl.RuleDes.e1",
    e2 ="ctrl.RuleDes.e2",
    -- close ="ctrl.RuleDes.close",
    show ="ctrl.RuleDes.show",
    root="ctrl.RuleDes.root",

}

function M.new(...)
	return M(...);
end;


function M.ctor(self,ctrl)
    M.super.ctor(self);

    self.ctrl=ctrl
    self.ui=ctrl:InitUiInst2(ctrl.main_inst,instStr)

    CallBackManager:AddRbxConnect(self,self.ui.show.Activated, function()
         if self.ui.root.Visible then
            self:Hide()
         else
            self:Show()
         end
	end);

    self:Hide()

    local s1=_G.CommonOHOH.load.PetTool().GetLevelBoostStr(1)
    local s2=_G.CommonOHOH.load.PetTool().GetLevelBoostStr(2)
    local s3=_G.CommonOHOH.load.PetTool().GetLevelBoostStr(3)

    local e1=_G.CommonOHOH.load.PetTool().GetEvolutionBoostStr(2)
    local e2=_G.CommonOHOH.load.PetTool().GetEvolutionBoostStr(3)

    self:UpdateData(s1,s2,s3,e1,e2)

end;


function M.dtor(self)
	M.super.dtor(self);
end;

--更新说明信息
function M.UpdateData(self,s1,s2,s3,e1,e2)
    self.ui.s1.Text=s1.."%"
    self.ui.s2.Text=s2.."%"
    self.ui.s3.Text=s3.."%"

    self.ui.e1.Text=e1.."%"
    self.ui.e2.Text=e2.."%"
end

function M.Show(self)
   self.ui.root.Visible=true
end

function M.Hide(self)
    self.ui.root.Visible=false
end


return M